package com.cloud.admin.support;

public class TimeSequence {
    private static long timeMillis = 0;

    /**
     * 获取当前时间序列并去重处理
     *
     * @return long
     */
    public static synchronized long getTimeMillis() {
        long currentTimeMillis = System.currentTimeMillis();
        if (currentTimeMillis == timeMillis) {
            currentTimeMillis++;
        }
        timeMillis = currentTimeMillis;
        return timeMillis;
    }
}
